﻿using System;

namespace EnterpriseLibraryExtensions.Events
{
    /// <summary>
    /// The generic EventArgs class makes implementing event handling using
    /// the generic EventHandler much faster as no additional delegates have
    /// to be declared for the signature of the events.
    /// </summary>
    /// <typeparam name="T">The value type to use for the event</typeparam>
    public class EventArgs<T> : EventArgs
    {
        /// <summary>
        /// Initializes a new instance of the EventArgs class.
        /// The constructor must be passed the value concerning
        /// the event. The method accepts null.
        /// </summary>
        /// <param name="value">The value to assign the event raised.</param>
        public EventArgs(T value)
        {
            Value = value;
        }

        /// <summary>
        /// Gets the value relevant for the raised event.
        /// </summary>
        public T Value { get; private set; }
    }
}
